﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Omes.Services;

namespace FashionMural.Web
{
    public partial class BusinessVista : System.Web.UI.Page
    {
        private IResourceService  resouceservice;
        public string HtmlText { set; get; }
        protected void Page_Load(object sender, EventArgs e)
        {
            int pid = int.Parse(System.Configuration.ConfigurationManager.AppSettings["scqj"]);
            resouceservice =new ResourceService();
            HtmlText = resouceservice.GetHtml(pid).Content;
        }

        protected void Unnamed_Click(object sender, EventArgs e)
        {
            string userName = tbName.Text;
            int mobilePhone = string.IsNullOrEmpty(tbMPhone.Text) ? 0 : Convert.ToInt32(tbMPhone.Text);
            int staticPhone = string.IsNullOrEmpty(tbPhone.Text) ? 0 : Convert.ToInt32(tbPhone.Text);
            string contactTime = tbTime.Text;
            string content = TextBox1.Text;
            DbServer db = new DbServer();
            int mid = db.AddJoinUsMessage(userName, mobilePhone, staticPhone, contactTime, content);
            if(mid > 0)
            {
                Response.Write("<script type='text/javascript'>alert('添加成功！')</script>");
            }
            else
            {
                Response.Write("<script type='text/javascript'>alert('添加失败！')</script>");
            }
        }
    }
}